package com.itheima.练习.test6;

import java.io.*;
import java.net.Socket;

//客户端
public class Client {

    public static void main(String[] args) throws IOException {
        Socket socket=new Socket("127.0.0.1",10000);

        BufferedInputStream bis=new BufferedInputStream(new FileInputStream("E:\\4399\\1692958019607.png"));
        BufferedOutputStream bos=new BufferedOutputStream(socket.getOutputStream());

        byte[]bytes=new byte[2048];
        int b;
        while ((b=bis.read(bytes))!=-1) {
            bos.write(bytes, 0, b);
        }
        socket.shutdownOutput();

        BufferedReader br=new BufferedReader(new InputStreamReader(socket.getInputStream()));

        String line = br.readLine();
        System.out.println(line);
        socket.close();
    }
}
